cordova.define("cordova.rfd8500.RfidComm", function(require, exports, module){
	var exec = require('cordova/exec');


	exports.getAvaliableDevices = function (success, error) {
	    exec(success, error, 'RfidComm', 'getAvaliableDevices', []);
	};

	exports.initRfidReader = function (indexOfDevice, success, error) {
	    exec(success, error, 'RfidComm', 'initRfidReader', [indexOfDevice]);
	};

	exports.disconnectReader = function (success, error) {
	    exec(success, error, 'RfidComm', 'disconnectReader', []);
	};


	exports.inventory = function (success, error) {
	    exec(success, error, 'RfidComm', 'inventory', []);
	};

	exports.inventoryByRegion = function (region, success, error) {
	    exec(success, error, 'RfidComm', 'inventoryByRegion', [region]);
	};

	exports.stopInventory = function (success, error) {
	    exec(success, error, 'RfidComm', 'stopInventory', []);
	};

	exports.enableDPO = function (success, error) {
	    exec(success, error, 'RfidComm', 'enableDPO', []);
	};

	exports.disableDPO = function (success, error) {
	    exec(success, error, 'RfidComm', 'disableDPO', []);
	};

	exports.read = function (tagId, accessPwd, memRegion, offset, length, success, error) {
	    exec(success, error, 'RfidComm', 'read', [tagId, accessPwd, memRegion, offset, length]);
	};

	exports.write = function (tagId, accessPwd, memRegion, offset, data, success, error) {
	    exec(success, error, 'RfidComm', 'write', [tagId, accessPwd, memRegion, offset, data]);
	};

	exports.listenTriggerPress = function (success, error) {
	    exec(success, error, 'RfidComm', 'listenTrigPress', []);
	};


	exports.removeTriggerPressListen = function (success, error) {
	    exec(success, error, 'RfidComm', 'removeTrigPressListen', []);
	};

	exports.setBatchMode = function (mode, success, error) {
	    exec(success, error, 'RfidComm', 'setBatchMode', [mode]);
	};

	exports.setAccessPwd = function (tagId, accessPwd, newPwd, success, error) {
	    exec(success, error, 'RfidComm', 'setAccessPwd', [tagId, accessPwd, newPwd]);
	};

	exports.delAccessPwd = function (tagId, accessPwd, success, error) {
	    exec(success, error, 'RfidComm', 'delAccessPwd', [tagId, accessPwd]);
	};

	exports.setKillPwd = function (tagId, accessPwd, killPwd, success, error) {
	    exec(success, error, 'RfidComm', 'setKillPwd', [tagId, accessPwd, killPwd]);
	};

	exports.delKillPwd = function (tagId, accessPwd, success, error) {
	    exec(success, error, 'RfidComm', 'delKillPwd', [tagId, accessPwd]);
	};

	exports.erase = function (tagId, accessPwd, memRegion, offset, length, success, error) {
	    exec(success, error, 'RfidComm', 'erase', [tagId, accessPwd, memRegion, offset, length]);
	};

	exports.lock = function (tagId, accessPwd, memRegion, lockCode, success, error) {
	    exec(success, error, 'RfidComm', 'lock', [tagId, accessPwd, memRegion, lockCode]);
	};

	exports.kill = function (tagId, killPwd, success, error) {
	    exec(success, error, 'RfidComm', 'kill', [tagId, killPwd]);
	};

	exports.setStopTriggerType = function (stopTriggerType, duration, success, error) {
	    exec(success, error, 'RfidComm', 'setStopTriggerType', [stopTriggerType, duration]);
	};

	exports.setPowerLevel = function (powerLevel, success, error) {
	    exec(success, error, 'RfidComm', 'setPowerLevel', [powerLevel]);
	};


	exports.getBatteryLevel = function (success, error) {
	    exec(success, error, 'RfidComm', 'getBatteryLevel', []);
	};

	exports.clearContext = function (success, error) {
	    exec(success, error, 'RfidComm', 'clearContext', []);
	};

	exports.setSession = function (session, success, error) {
	    exec(success, error, 'RfidComm', 'setSession', [session]);
	};
})